package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.CsFactoryFallBack;
import cn.cs.pojo.CsFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = CsFactoryFallBack.class)
public interface CsFactoryClient {


    @RequestMapping(value = "/getCsFactoryById", method = RequestMethod.POST)
    public CsFactory getCsFactoryById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getCsFactoryByIdName", method = RequestMethod.POST)
    public CsFactory getCsFactoryByIdName(@RequestParam("factory_id") String factory_id, @RequestParam("factory_name") String factory_name) throws Exception;

    @RequestMapping(value = "/getCsFactoryByUserName", method = RequestMethod.POST)
    public CsFactory getCsFactoryByUserName(@RequestParam("factoryCode") String username) throws Exception;

    @RequestMapping(value = "/getCsFactoryListByMap", method = RequestMethod.POST)
    public List<CsFactory> getCsFactoryListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getCsFactoryCountByMap", method = RequestMethod.POST)
    public Integer getCsFactoryCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/insertCsFactory", method = RequestMethod.POST)
    public Integer insertCsFactory(@RequestBody CsFactory csFactory) throws Exception;

    @RequestMapping(value = "/updateCsFactory", method = RequestMethod.POST)
    public Integer updateCsFactory(@RequestBody CsFactory csFactory) throws Exception;

    @RequestMapping(value = "/deleteCsFactoryById", method = RequestMethod.POST)
    public Integer deleteCsFactoryById(@RequestParam("id") String id) throws Exception;

}

